
<style>
    body{
        background: #f2f2f2;
    }
    .container{
        background: #fff;
        margin-top: 50px;
    }
</style>

<div style="width: 100%;height: auto;overflow:hidden;">
    <!-- 头部begin -->
        <nav class="navbar navbar-expand-md bg-dark navbar-dark fixed-top">
            <a class="navbar-brand" style="background: url('public/static/img/pub/head/logo.png') 0 0 no-repeat;padding-left: 34px;" href="/">欢迎来到{$Think.config.siteName}最新影片资源</a>
            <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#collapsibleNavbar">
                <span class="navbar-toggler-icon"></span>
            </button>
            <div class="collapse navbar-collapse" id="collapsibleNavbar">
                <ul class="nav navbar-nav navbar-right" >
                    <li class="nav-item">
                        <a  class="nav-link" href="/">首页</a>
                    </li>
                    {volist name="cataLogList" id="vo"}
                    <li class="nav-item">
                        <a  class="nav-link" href="{:url('xl/index','cataLog_id='.$vo.id)}">{$vo.name}</a>
                    </li>
                    {/volist}

                    <li class="nav-item">
                        <a class="nav-link" href="javascript:;">/</a>
                    </li>

                    <li class="nav-item">
                        <a class="nav-link" onclick="alert('请点击Ctrl+D收藏')" href="#">收藏网站</a>
                    </li>
                    {if condition="$Think.session.uid.userName!='' and $Think.session.uid.userName!=null"}
                    {if condition="$Think.session.uid.isVip==1"}
                    <li class="nav-item">
                        <a class="nav-link" data-toggle='tooltip' data-placement="bottom" title="{$Think.session.uid.expireDate|substr=0,11}到期" href="javascript:;">{$Think.session.uid.userName}</a>
                    </li>

                    {else/}
                    <li class="nav-item">
                        <a class="nav-link" data-toggle='tooltip' data-placement="bottom" title="你的车开到 {$Think.session.uid.expireDate|substr=0,11}没油了，请加油后继续上路！"  href="javascript:;">{$Think.session.uid.userName}</a>
                    </li>
                    {/if}
                    <li class="nav-item">
                        <a class="nav-link" target="_blank" href="https://w.url.cn/s/A5msWtt">加点油</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" onclick="fuelFilling()"  href="javascript:;">使用加油卡</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" id="globalLoginBtn_loginOut" href="javascript:;">退出</a>
                    </li>
                    {else /}
                    <li class="nav-item">
                        <a class="nav-link" data-toggle="modal" data-target="#myModal" href="javascript:;">登录</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" id="globalLoginBtn_register_input" href="{:url('index/Commonverification/register_input')}">注册</a>
                    </li>
                    {/if}

                    {if condition="$Think.session.AdminUId.userName!='' and $Think.session.AdminUId.userName!=null"}
                        <li class="nav-item">
                            <a class="nav-link" href="{:url('admin/Manager/film_list')}">进入后台</a>
                        </li>
                    {/if}
                </ul>
            </div>
        </nav>
    <!--<div class="lanren-search-form">

                        <div id="search-bd" class="search-bd">
                            <ul>
                                <li class="selected">影片名</li>
                                <li>演员名</li>
                            </ul>
                        </div>
                        <div id="search-hd" class="search-hd">
                            <div style="width: 90%;height: auto;">
                                <div class="search-bg"></div>
                                <input type="text" id="s1" name="name"  autocomplete="off" value=""  class="search-input">
                                <input type="text" id="s2" name="actor" autocomplete="off" value="" class="search-input">
                                <span class="s1 pholder">请输入影片关键字</span>
                                <span class="s2 pholder">请输入演员关键字</span>
                            </div>
                            <div style="width: 10%;height: auto;">
                                <input type="submit" id="submit" class="btn-search" value="搜索"/>
                            </div>
                        </div>
                    </div>-->
   <!-- <div class="menu container-fluid" style="background: #00AFE4;">
        <ul>
            <li><a href="/">首页</a></li>
            {volist name="cataLogList" id="vo"}
                <li><a href="{:url('xl/index','cataLog_id='.$vo.id)}">{$vo.name}</a></li>
            {/volist}
        </ul>
    </div>-->

    <!-- 模态框 -->
    <div class="modal fade" id="myModal">
        <div class="modal-dialog">
            <div class="modal-content">

                <!-- 模态框头部 -->
                <div class="modal-header">
                    <h4 class="modal-title">登录</h4>
                    <button type="button" class="close" data-dismiss="modal">&times;</button>
                </div>

                <!-- 模态框主体 -->
                <div class="modal-body">
                    <form id="login_form">
                        <div class="form-group">
                            <label for="email">账号/邮箱</label>
                            <input type="email" name="account_l" class="form-control" id="email" placeholder="账号/邮箱">
                        </div>
                        <div class="form-group">
                            <label for="pwd">密码</label>
                            <input type="password" name="password_l" class="form-control" id="pwd" placeholder="密码">
                        </div>
                        <button type="button" class="btn btn-primary" id="login_btn">登录</button>
                    </form>
                </div>

                <!-- 模态框底部 -->
                <div class="modal-footer">
                    <button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button>
                </div>

            </div>
        </div>
    </div>
</div>
    <script>
        $(function () {
            /**登录*/
            $("#login_btn").click(function () {
                $.ajax({
                    url:"{:url('index/Commonverification/login')}",
                    type:"POST",
                    dataType:"json",
                    data:$("#login_form").serialize(),
                    success:function (data) {
                        if(data.code=="1"){
                            location.reload();
                        }else{
                            alert("用户名或密码错误！");
                        }
                    }
                });
            });

            /**登出*/
            $("#globalLoginBtn_loginOut").click(function () {
                $.ajax({
                    url:"{:url('index/Commonverification/login_out')}",
                    type:"POST",
                    dataType:"json",
                    success:function (data) {
                        if(data.code=="1"){
                            location.reload();
                        }else{
                            alert("登出失败！请稍后重试");
                        }
                    }
                });
            });

            $("[data-toggle='tooltip']").tooltip();
        });

        /**
         * 加油
         */
        function fuelFilling() {
           var vip_code =  prompt("请输入你的加油卡号：");
           if(vip_code!='' && vip_code!=undefined){
               $.ajax({
                   url:"{:url('xl/vipCodeVerification')}",
                   type:"POST",
                   dataType:"json",
                   data:{
                       vip_code:vip_code
                   },
                   success:function (data) {
                       if(data.code=="1"){
                           alert("加油成功，继续前行");
                           location.reload();
                       }else{
                           alert("加油失败！加油卡号不存在");
                       }
                   }
               });
           }else if(vip_code!=undefined){
               alert("请输入你的加油卡号!")
           }
        }
    </script>
    <!--登录 END-->
</div>